-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hotfix to hide the external link badge from cards #1231
Conversation
✅ Deploy Preview for veda-ui ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
}; | ||
} | ||
|
||
const isExternalLink = linkProperties.isLinkExternal ?? /^https?:\/\//.test(linkProperties.linkTo); | ||
const isExternalLink = /^https?:\/\//.test(linkProperties.linkTo); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes! this is what we all needed. Thanks for thinking through this again 🙇
@dzole0311 if you created the 5.9.1 patch from here, could you update the package.json too to when it merges, it has the udpate version reflected? |
## 🎉 Features * Card image/description independent of hero image/description by @dzole0311 in #1244 ## 🚀 Improvements * Cookie consent code cleanup by @snmln in #1199 , and @hanbyul-here in #1240 , and @hanbyul-here in #1241 * Add ADR about design system change by @j08lue in #890 * Update condition to run playwright tests on release branches by @dzole0311 in #1228 * Update STYLE_GUIDE.md by @AliceR in #1227 * Fix lint configuration by @AliceR in #1219 * Add tests for the AOI feature specification by @AliceR in #1216 * Set data catalog filters to be closed by default by @vgeorge in #1243 * Update tsconfig and make nav interfaces exposable for consumption by @sandrahoang686 in #1223 ## 🐛 Fixes * Hotfix to hide the external link badge from cards by @dzole0311 in #1231 ## New Contributors * @vgeorge made their first contribution in #1243 **Full Changelog**: v5.9.0...v5.10.0
Related Ticket: {link related ticket here}
Description of Changes
This update addresses a mistake I made from the initial fix involving the new
isExternalLink
prop, which unintentionally altered the behavior of external links. Basically, this prop not only hid the "External Link" badge but also incorrectly routed external links through React's internal routing, resulting in URLs likeearth.gov/visit/https://earth.gov/mobile-climate-mapper
instead of correctly navigating toearth.gov/mobile-climate-mapper
What's fixed here:
isExternalLink
prop to revert unintended internal link behaviorhideExternalLinkBadge
that more clearly describes it's role and is used specifically for visually hiding the "External Link" badge without altering the link's external behaviorNotes & Questions About Changes
To minimize team effort for a hotfix release and since this fix is specific to the EIC instance only, I did the following:
Validation / Testing
hideExternalLinkBadge
prop to theExternal Link Test
storyOr check it out in practice on the EIC instance here, where the Mobile Climate Mapper card has no "External Link" badge anymore: